home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbwinfnt.zip / EX_DSTRG.BAS < prev    next >
BASIC Source File  |  1994-03-01  |  1KB  |  33 lines

  1.       REM:  EX_DSTRG.BAS, Unregistered Version 1.0
  2.       REM:  Example of using DispString to display text.
  3.  
  4.       DECLARE SUB DispString (Text$, FClr%, BClr%, X%, Y%, FontArray%())
  5.       DECLARE SUB LoadRsrcFileFont (FlName$, FontNum%, FontArray%(), RetCode%, RetMsg$)
  6.  
  7.       '...setup a VGA screen mode...
  8.       SCREEN 12
  9.     
  10.       '...dim array for font data (use REDIM so its DYNAMIC)...
  11.       REDIM FontArray%(1)
  12.   
  13.       PRINT : PRINT "Loading a font from SAMPLE.FON..."
  14.   
  15.       '...load the font in the example FON file...
  16.       CALL LoadRsrcFileFont("SAMPLE.FON", 1, FontArray%(), RetCode%, RetMsg$)
  17.     
  18.       '...check the return code...
  19.       IF (RetCode% <> 0) THEN STOP
  20.     
  21.       '...display string in foreground and background color...
  22.       CALL DispString(" Foreground & Background ", 4, 7, 100, 100, FontArray%())
  23.    
  24.       '...text foreground only, negative color forces no background...
  25.       CALL DispString(" Foreground Only ", 4, -1, 100, 135, FontArray%())
  26.    
  27.       '...text background only, negative color forces no foreground...
  28.       CALL DispString(" Background Only ", -1, 7, 100, 170, FontArray%())
  29.     
  30.       END
  31.    
  32.  
  33.